package com.jiezuo.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* @description   工作流自定义权限类型
* @author        庞留杰
* @date          2020/9/11 16:03
* @version       V1.0
**/
@Getter
@AllArgsConstructor
public enum CustomUserTypeEnum {

    //USER("1", "用户"),
    DEPT("1", "部门"),
    POST("2", "岗位"),
    GROUP("3", "岗位组"),
    LEVEL("4", "岗位等级"),
    DEPT_POST("5", "部门岗位");

    private String key;
    private String description;

    public static CustomUserTypeEnum actionOf(String key) {
        for(CustomUserTypeEnum actionEnum : values()){
            if(actionEnum.getKey().equals(key)){
                return actionEnum;
            }
        }
        throw new RuntimeException("[自定义权限类型]未找到对应的枚举");
    }
}
